<extend name="Console:index"/>
<block name="main">
    <div>
        <ol class="breadcrumb">
            <li class="active">权限管理</li>
            <li class="active"><a href="{:U('Node/index')}">权限节点管理</a></li>
           <empty name="node" >
               <li class="active">节点添加</li>
               <else/>
               <li class="active">节点修改</li>
           </empty>
        </ol>
    </div>
    <div class="row">
        <div class="col-md-offset-4 col-md-4">
            <form class="form-horizontal" method="post"
                <empty name="node" >
                    action="{:U('Node/insertNode')}"
                    <else/>
                    action="{:U('Node/saveNode')}"
                </empty>>

                <input name="nid" type="hidden" value="{$node.id}"/>

                <div id="legend" class="">

                    <empty name="node" >
                        <legend class="">节点添加</legend>
                        <else/>
                        <legend class="">节点修改</legend>
                    </empty>
                </div>

                <div class="form-group">
                    <label class="col-md-4 control-label" for="input01">节点名称</label>
                    <div class="col-md-8">
                        <input placeholder="请输入节点名称" class="form-control" type="text" id="input01" name="name" value="{$node.name}">
                        <p class="help-block"></p>
                    </div>
                </div>

            <div class="form-group">
                <label class="col-md-4 control-label" for="input10">节点中文</label>
                <div class="col-md-8">
                    <input placeholder="请输入节点名称" class="form-control" type="text" id="input10" name="title" value="{$node.title}">
                    <p class="help-block"></p>
                </div>
            </div>

                <div class="form-group">
                    <label class="col-md-4 control-label" for="input02">节点描述</label>
                    <div class="col-md-8">
                        <input placeholder="请输入节点描述" class="form-control" type="text" id="input02" name="remark" value="{$node.remark}">
                        <p class="help-block"></p>
                    </div>
                </div>

            <div class="form-group">
                <label class="col-md-4 control-label">节点类型</label>
                <div class="col-md-8">
                    <select class="form-control" name="level">
                            <option  value="1" <eq name="node.level" value="1" > selected</eq> >应用（模块）</option>
                            <option  value="2" <eq name="node.level" value="2" > selected</eq>>&nbsp;&nbsp;&nbsp;&nbsp;┣控制器</option>
                            <option  value="3" <eq name="node.level" value="3" > selected</eq>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;┣方法</option>
                    </select>
                </div>

            </div>

                <div class="form-group">
                    <label class="col-md-4 control-label">父节点</label>
                    <div class="col-md-8">
                        <select class="form-control" name="pid">
                            <option value="0"> [0]根节点</option>
                            <volist name="nodeList" id="nl">
                                <option value="{$nl.id}" <eq name="nl.id" value="$node.pid" > selected</eq>><for start="1" end="$nl.level" >&nbsp;&nbsp;&nbsp;&nbsp;</for> [{$nl.sort}]┣{$nl.title}--{$nl.name}</option>
                            </volist>
                        </select>
                    </div>

                </div>

            <div class="form-group">
                <label class="col-md-4 control-label" for="input11">排序值</label>
                <div class="col-md-8">
                    <input placeholder="请输入角色名称" class="form-control" type="text" id="input11" name="sort" value="{$node.sort}">
                    <p class="help-block"></p>
                </div>
            </div>


                <div class="form-group">
                   <label class="col-md-4 control-label">是否开启</label>
                    <div class="col-md-8">
                        <label class="radio-inline">
                            <input  value="0" type="radio" name="status" <notempty name="node.status"> <eq name="node.status" value="0">checked="checked"</eq> </notempty>  >禁用
                        </label>
                        <label class="radio-inline">
                            <input value="1" type="radio" name="status"   <notempty name="node.status"> <eq name="node.status" value="1">checked="checked"</eq> <else/> checked="checked"</notempty>        >开启
                        </label>
                    </div>
                </div>

                <div class="form-group">
                    <button class="btn btn-success col-md-offset-9" id="btn">提交</button>
                </div>

            </form>
        </div>
    </div>


    <script>
        $(function(){

        })
    </script>

</block>